using System;
using System.Collections.Generic;
using System.Text;
using DAP;
using Dominio;

namespace Presenters
{
    public class TesterListPresenter
    {
        private TesterRepository repository;
        public TesterListPresenter()
        {
            repository = new TesterRepository();
        }

        public IList<Tester> getAllTesters()
        {
           IList<Tester> testerList = repository.getAllTester();
           return testerList;
        }

        //public void changeTesterStatus(int id, string name, string lastName, string email, string address, string country, string city, string password, int dni, String state)
        //{

        //    Tester tester = new Tester(id, name, lastName, email, address, country, city, password, dni, changerStatus(state));
            
        //    repository.save(tester); 
            
        //}
        public void changeTesterStatus(int id)
        {

            Tester tester = repository.getUserById(id);
            tester.State = changerStatus(tester.State);
            repository.save(tester);

        }
        public virtual String changerStatus(String status)
        {
            if (status.Equals("active"))
            {
                status = "not-Active";
            }
            else
            {
                status = "active";
            }
            return status;
        }

    }
}
